package com.kzw.oa.blog.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.kzw.oa.comm.model.TongBao;
import com.kzw.oa.comm.service.TongBaoService;

@Controller
@RequestMapping("/blog")
public class BlogAction {
	
	@Autowired
	private TongBaoService tongbaoService;
	
	@RequestMapping({"", "index"})
	public String index(Model model) {
		
		List<TongBao> list = tongbaoService.listMy();
		if(list.size() > 0) {
			model.addAttribute("tb", list.get(0));
		}
		
		return "blog/index";
	}
}
